import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
//列表数据
export const columns: BasicColumn[] = [
  {
    title: '供应商名称',
    align: "center",
    dataIndex: 'supplierName'
  },
  {
    title: '供应商等级',
    align: "center",
    dataIndex: 'supplierGrade'
  },
  {
    title: '供应商分类',
    align: "center",
    dataIndex: 'supplierClassification'
  },
  {
    title: '收款人全称',
    align: "center",
    dataIndex: 'payeeName'
  },
  {
    title: '税务登记证号',
    align: "center",
    dataIndex: 'taxRegistrationNo'
  },
  {
    title: '银行账号',
    align: "center",
    dataIndex: 'bankAccount'
  },
  {
    title: '开户行名称',
    align: "center",
    dataIndex: 'bankName'
  },
  {
    title: '联系人',
    align: "center",
    dataIndex: 'contacts'
  },
  {
    title: '手机',
    align: "center",
    dataIndex: 'cellPhoneNumber'
  },
  {
    title: '座机',
    align: "center",
    dataIndex: 'telephoneNumber'
  },
  {
    title: '传真',
    align: "center",
    dataIndex: 'faxNo'
  },
  {
    title: '邮箱',
    align: "center",
    dataIndex: 'mailboxNumber'
  },
  {
    title: '地址',
    align: "center",
    dataIndex: 'address'
  },
  {
    title: '介绍',
    align: "center",
    dataIndex: 'introduce'
  },
  {
    title: '资质凭证',
    align: "center",
    dataIndex: 'qualificationDocuments'
  },
  {
    title: '制单人ID',
    align: "center",
    dataIndex: 'creatorId'
  },
  {
    title: '制单人姓名',
    align: "center",
    dataIndex: 'creatorName'
  },
  {
    title: '是否删除',
    align: "center",
    dataIndex: 'isDelete'
  },
];

//查询数据
export const searchFormSchema: FormSchema[] = [
];

//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '供应商名称',
    field: 'supplierName',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
      return [
              { required: true, message: '请输入供应商名称!'},
             ];
    },
  },
  {
    label: '供应商等级',
    field: 'supplierGrade',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
      return [
              { required: true, message: '请输入供应商等级!'},
             ];
    },
  },
  {
    label: '供应商分类',
    field: 'supplierClassification',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
      return [
              { required: true, message: '请输入供应商分类!'},
             ];
    },
  },
  {
    label: '收款人全称',
    field: 'payeeName',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
      return [
              { required: true, message: '请输入收款人全称!'},
             ];
    },
  },
  {
    label: '税务登记证号',
    field: 'taxRegistrationNo',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
      return [
              { required: true, message: '请输入税务登记证号!'},
             ];
    },
  },
  {
    label: '银行账号',
    field: 'bankAccount',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
      return [
              { required: true, message: '请输入银行账号!'},
             ];
    },
  },
  {
    label: '开户行名称',
    field: 'bankName',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
      return [
              { required: true, message: '请输入开户行名称!'},
             ];
    },
  },
  {
    label: '联系人',
    field: 'contacts',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
      return [
              { required: true, message: '请输入联系人!'},
             ];
    },
  },
  {
    label: '手机',
    field: 'cellPhoneNumber',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
      return [
              { required: true, message: '请输入手机!'},
             ];
    },
  },
  {
    label: '座机',
    field: 'telephoneNumber',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
      return [
              { required: true, message: '请输入座机!'},
             ];
    },
  },
  {
    label: '传真',
    field: 'faxNo',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
      return [
              { required: true, message: '请输入传真!'},
             ];
    },
  },
  {
    label: '邮箱',
    field: 'mailboxNumber',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
      return [
              { required: true, message: '请输入邮箱!'},
             ];
    },
  },
  {
    label: '地址',
    field: 'address',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
      return [
              { required: true, message: '请输入地址!'},
             ];
    },
  },
  {
    label: '介绍',
    field: 'introduce',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
      return [
              { required: true, message: '请输入介绍!'},
             ];
    },
  },
  {
    label: '资质凭证',
    field: 'qualificationDocuments',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
      return [
              { required: true, message: '请输入资质凭证!'},
             ];
    },
  },
  {
    label: '制单人ID',
    field: 'creatorId',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
      return [
              { required: true, message: '请输入制单人ID!'},
             ];
    },
  },
  {
    label: '制单人姓名',
    field: 'creatorName',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
      return [
              { required: true, message: '请输入制单人姓名!'},
             ];
    },
  },
  {
    label: '是否删除',
    field: 'isDelete',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
      return [
              { required: true, message: '请输入是否删除!'},
             ];
    },
  },
	// TODO 主键隐藏字段，目前写死为ID
  {
    label: '',
    field: 'id',
    component: 'Input',
    show: false,
  },
];
